#!/usr/bin/env python
# -*- coding:utf-8 -*-

from flask_restful import Api

from . import equipment_blueprint
from api_1_0.equipmentResource.equipmentResource import EquipmentResource
from api_1_0.equipmentResource.equipmentOtherResource import EquipmentUpdateResource, EquipmentAddResource, \
    EquipmentDelResource

api = Api(equipment_blueprint)

api.add_resource(EquipmentResource, '/equipment/<equipment_id>', '/equipment', endpoint='Equipment')


@equipment_blueprint.route('/equipment/update/<equipment_id>', methods=['PUT'], endpoint='EquipmentUpdate')
def update(equipment_id):
    return EquipmentUpdateResource.update(equipment_id)


# 添加实验设备
api.add_resource(EquipmentAddResource, '/equipment/add', endpoint='add_equipment')

# 删除实验设备
api.add_resource(EquipmentDelResource, '/equipment/delete', endpoint='delete_equipment')
